#ifndef GRAPH_NODE_H
#define GRAPH_NODE_H

#include <QtCore/QSet>

namespace core
{
class DirectedGraph;
class INodeData;

class Node
{
public:
    static Node* create(INodeData* data);
    ~Node();

    const INodeData* getData() const;

    QSet<Node* > getIncomingConnections() const;
    QSet<Node* > getOutgoingConnections() const;

private:
    Node(INodeData* data);

    void addIncoming(Node* node);
    void addOutgoing(Node* node);

    void removeIncoming(Node* node);
    void removeOutgoing(Node* node);

private:
    friend class DirectedGraph;

    INodeData* m_data;
    QSet<Node* > m_incomingConnections;
    QSet<Node* > m_outgoingConnections;
};

} // namespace core

#endif
